home *** CD-ROM | disk | FTP | other *** search
/ The Games Machine 76 / XENIATGM66.iso / Indiana Jones / Indiana Jones.exe / RESOURCE / PREVIEW.GOB / cog_nub_elevkey.cog < prev    next >
Text File  |  1999-11-15  |  3KB  |  141 lines

  1. # Jones 3D Cog Script
  2. #
  3. # nub_ElevKey.cog
  4. #
  5. # [TL]
  6. #
  7. # (C) 1999 LucasArts Entertainment Co. All Rights Reserved
  8. #
  9. # ========================================================================================
  10. symbols
  11.  
  12. message        activated
  13. message        startup
  14.  
  15. thing        player                                local
  16. thing        keyhole0
  17. thing        gate0
  18. thing        gate1
  19. thing        lockCam
  20. thing        actor
  21. thing        key
  22.  
  23. sound        voice0=INXJ082.WAV                    local
  24. sound        voice1=INXJ105.WAV                    local
  25. sound        voice2=INXJ100.WAV                    local
  26. sound        click=tem_monkeykey_unlock_c.wav    local
  27. sound        gatesound=nub_gate_open_c.wav        local
  28. keyframe    opengate=nub_gate_elvatr.key        local
  29. keyframe    unlock=in_activate_medium.key        local
  30.  
  31. int            unlocked0=0                            local
  32. int            tracknum0                            local
  33. int            curcam                                local
  34. int            track0                                local
  35. int            track1                                local
  36.  
  37. end
  38.  
  39. # ========================================================================================
  40. code
  41.  
  42. startup:
  43. StartCutscene(0);
  44. EndCutscene();
  45.  
  46. player = GetLocalPlayerThing();
  47. SetThingFlags(gate1, 0x80000);
  48. SetThingFlags(key, 0x80000);
  49. SetCollideType(key, 0);
  50.  
  51. return;
  52.  
  53. # ........................................................................................
  54. activated:
  55.  
  56. if (GetSenderRef() == gate0)
  57. {
  58.     MakeMeStop();
  59.     DeselectWeaponWait(player);
  60.     StartCutscene(1);
  61.     PlayVoice(player, voice2, 1.0, 1);
  62.     ClearActorFlags(player, 0x200000);
  63.     EndCutscene();
  64. }
  65. if (GetSenderRef() == keyhole0)
  66. {
  67.     if (unlocked0 == 1)    return;
  68.     curcam = GetCurrentCamera();
  69.     if (GetCurItem(player) != 68)
  70.     {
  71.         MakeMeStop();
  72.         DeselectWeaponWait(player);
  73.         StartCutscene(1);
  74.         PlayVoice(player, voice0, 1.0, 1);
  75.         ClearActorFlags(player, 0x200000);
  76.         EndCutscene();
  77.     }
  78.     if (GetCurItem(player) == 68)
  79.     {
  80.         MakeMeStop();
  81.         DeselectWeaponWait(player);
  82.         StartCutscene(1);
  83.         CopyPlayerHolsters(player, actor);
  84.  
  85.         SetCameraLookInterp(2, 0);
  86.         SetCameraPosInterp(2, 0);
  87.         Sleep(0.01);
  88.         
  89.         SetThingFlags(player, 0x80000);
  90.         ClearThingFlags(actor, 0x80000);
  91.         ResetThing(player);
  92.         
  93.         SetCameraFocus(2, lockCam);
  94.         SetCameraSecondaryFocus(2, keyHole0);
  95.         SetCameraLookInterp(2, 1);
  96.         SetCurrentCamera(2);
  97.         SetCameraFOV(60, 0, 0.0);
  98.         
  99.         PlayKey(actor, unlock, 4, 0x12, 0);
  100.         
  101.         Sleep(0.75);
  102.         track0 = PlaySoundThing(click, keyhole0, 1.0, -1, -1, 0);
  103.         ClearThingFlags(key, 0x80000);
  104.         WaitForSound(track0);
  105.         
  106.         SetCameraSecondaryFocus(2, gate1);
  107.         SetCameraFOV(90, 1, 1.0);
  108.         Sleep(0.25);
  109.         
  110.         ChangeInv(player, 68, -1);
  111.         DestroyThing(gate0);
  112.         ClearThingFlags(gate1, 0x80000);
  113.         
  114.         tracknum0=PlayKey(gate1, opengate, 4, 0x4, 0);
  115.         track1 = PlaySoundThing(gatesound, gate1, 1.0, -1, -1, 0);
  116.         WaitForSound(track1);
  117.         unlocked0 = 1;
  118.         PlayVoice(player, voice1, 1.0, 1);
  119.         Sleep(1.0);
  120.         
  121.         SetCameraPosition(1, GetThingPos(lockCam));
  122.         SetCurrentCamera(1);
  123.         ResetCameraFOV(0, 0.0);
  124.         SetCameraLookInterp(2, 0);
  125.         
  126.         
  127.         CopyOrientandPos(actor, player);
  128.         ClearActorFlags(player, 0x200000);
  129.         ClearThingFlags(player, 0x80000);
  130.         SetThingFlags(actor, 0x80000);
  131.         StopAnim(tracknum0);
  132.         EndCutScene();
  133.     }
  134. }
  135.  
  136. return;
  137.  
  138. # ........................................................................................
  139. end
  140.  
  141.